﻿using Freshbox2._0.BLL;
using Freshbox2._0.MODEL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Freshbox2._0.UI.Controllers
{
    public class TestBootstrapController : BaseController<user>
    {
        //
        // GET: /TestBootstrap/

        public override BLL.BaseBll<user> bll
        {
            get
            {
                return new UserBll();
            }

        }
        protected admin CurrentUer
        {
            get { return Session["CurrentUer"] == null ? null : (admin)Session["CurrentUer"]; }
        }
        //加载数据列表 查询方法     limit, offset+1,  

        public JsonResult Get2(int limit, int offset, user model)
        {
            int count;
            var list = bll.Search(model, x => true, true, x => x.userCode, limit, offset + 1, out count).ToList().Select(x => new
            {
                x.userCode,
                x.userName, 
                x.userPhone,
      
            }).ToList();
            return Json(new { total = count, rows = list },JsonRequestBehavior.AllowGet);
        }
    }
}
